package com.hackordie.operations.creates;

import com.hackordie.commons.HackOrDieResult;
import com.hackordie.commons.hardware.components.AComponent;
import com.hackordie.exceptions.HackOrDieException;
import com.hackordie.operations.AHackOrDieOperationComponents;

public class CreateComponent extends AHackOrDieOperationComponents{

    private AComponent component;
    
    public CreateComponent(AComponent component) {
        super();
        this.component = component;
    }

    @Override
    protected boolean checkParameters() {
        // TODO Auto-generated method stub
        return true;
    }

    @Override
    protected HackOrDieResult executeOperation() throws HackOrDieException {
        result.setCorrect(componentDao.create(component));
        result.setObject(component);
        return result;
    }
}
